<template>
    <div class="informationData-view">

      <div class="nameInput">
        <el-input v-model="data.real_name" placeholder="患者姓名"></el-input>
      </div>


      <el-select v-model="data.gender" placeholder="请选择">
        <el-option
          key="0"
          label="男"
          value="0">
        </el-option>
        <el-option
          key="1"
          label="女"
          value="1">
        </el-option>
      </el-select>

      <div class="ageView">
        <el-input v-model="year" oninput ="value=value.replace(/[^\d]/g,'')"></el-input>
        <div class="age-unit">岁</div>
        <el-input v-model="month" oninput ="value=value.replace(/[^\d]/g,'')"></el-input>
        <div class="age-unit">月</div>
        <el-input v-model="day" oninput ="value=value.replace(/[^\d]/g,'')"></el-input>
        <div class="age-unit">日</div>
      </div>

      <div class="phoneInput">
        <el-input v-model="data.mobile" placeholder="手机号"></el-input>
      </div>

      <div class="codeInput">
        <el-input v-model="data.id_card" placeholder="身份证号"></el-input>
      </div>

    </div>
</template>

<script>
    export default {
        name: "informationData",
        data:function () {
            return{
                data:{
                    real_name:'',
                    gender:'0',
                    age:'',
                    id_card:'',
                    mobile:'',
                    address:'',
                },
                year:0,
                month:0,
                day:0,
            }
        },
        methods:{
            validate:function () {
                // if (this.data.real_name == ""){
                //     this.$message.error('请输入患者姓名');
                //     return null
                // }
                this.data.age = this.year + "," + this.month + "," + this.day;
                return this.data;
            },
            clearData:function () {
                this.data = {
                    real_name:'',
                    gender:'0',
                    age:'',
                    id_card:'',
                    mobile:'',
                    address:'',
                }
                this.year = 0;
                this.month = 0;
                this.day = 0;
            }
        }
    }
</script>

<style lang="scss">
  @import "@/assets/scss/payOrDrug/informationData.scss";
</style>
